package practice07;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice07
 * @ClassName: Voter
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/6 9:09
 * @Copyright 大牛版板所有
 */
public class Voter {
    private static int poll; // 票数


    public Voter() {
        poll++;
    }

    public static int getPoll() {
        return poll;
    }

    public String calcPoll(){
        if (poll >= 100){
            return "结束";
        }
        return "继续";
    }

    public static void main(String[] args) {
        String result;
        do {
            Voter voter = new Voter();
            result = voter.calcPoll();
            System.out.println("已经投了："+Voter.getPoll()+"票!");
        }while ("继续".equals(result));
        System.out.println("票数已经满100票，停止投票！");
    }
}
